package com.simple.business.service.utilService.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.github.zuihou.base.service.SuperServiceImpl;
import com.simple.business.domain.entity.config.SystemConfig;
import com.simple.business.mapper.utilMapper.SystemConfigMapper;
import com.simple.business.service.utilService.SystemConfigService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

/**
 * @desc
 * @Author Simple
 * @Date 2025/3/10 22:17
 **/
@Slf4j
@Service
// @DS("toy")
public class SystemConfigServiceImpl extends SuperServiceImpl<SystemConfigMapper, SystemConfig> implements SystemConfigService {

    /**
     * 获取验证码开关
     * @return
     */
    @Override
    public boolean getCaptchaEnabled() {
        return Boolean.parseBoolean(getOne(Wrappers.<SystemConfig>lambdaQuery()
                .eq(SystemConfig::getConfigKey, "sys.account.captchaEnabled")).getConfigValue());
    }
}
